package cc.abanlee.framework.web.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import javax.validation.constraints.NotNull;

/**
 * @author: create by 飞鱼
 * @version: v1.0
 * @description:
 * @date:2022/8/16
 */
@ConfigurationProperties(prefix = "li.web")
@Data
public class WebProperties {

    @NotNull(message = "APP API 不能为空")
    private Api appApi = new Api("/app-api", "**.controller.app.**");
    @NotNull(message = "Admin API 不能为空")
    private Api adminApi = new Api("/admin-api", "**.controller.admin.**");

    @Data
    @AllArgsConstructor
    public static class Api{

        /**
         *  API 前缀，实现所有 Controller 提供的 RESTFul API 的统一前缀
         */
        private String prefix;

        /**
         * Controller 所在包的 Ant 路径规则
         */
        private String controller;
    }
}
